package com.chuang.server.pojo;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class ResultBean {
    private long code;
    private String message;
    private Object data;

    /*
    * 返回成功结果 无数据
    * */
    public static ResultBean success(String message){
        return new ResultBean(200,message,null);
    }
    /*
     * 返回成功结果 有数据
     * */
    public static ResultBean success(String message,Object o){
        return new ResultBean(200,message,o);
    }
    /*
     * 返回失败结果 无数据
     * */
    public static ResultBean error(String message){
        return new ResultBean(500,message,null);
    }
    /*
     * 返回失败结果 有数据
     * */
    public static ResultBean error(String message,Object o){
        return new ResultBean(500,message,o);
    }
 }
